Ordernile::Application.routes.draw do 
  match ':controller(/:action(/:id))(.:format)'
  root :to => 'merchants#landing'
  
  match '/users/login', :controller => 'users', :action => 'login'
  match '/users/logout', :controller => 'users', :action => 'logout'
  match '/users/edit', :controller => 'users', :action => 'edit'  
  match '/users/authenticate', :controller => 'users', :action => 'authenticate'  
  match '/order/add_to_cart/:id', :controller => 'order', :action => 'add_to_cart'
  match '/signup',  to: 'users#new'
  match '/login',  to: 'users#login'
  match '/profile', to: 'users#profile'
  
  resources :products
  resources :users
  resources :merchants
  resources :merchant_product_categories

  
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => 'welcome#index'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.

end
#== Route Map
# Generated on 26 Jul 2012 16:11
#
#                           root        /                                               merchants#index
#                    users_login        /users/login(.:format)                          users#login
#                   users_logout        /users/logout(.:format)                         users#logout
#                     users_edit        /users/edit(.:format)                           users#edit
#             users_authenticate        /users/authenticate(.:format)                   users#authenticate
#                                       /order/add_to_cart/:id(.:format)                order#add_to_cart
#                         signup        /signup(.:format)                               users#new
#                          login        /login(.:format)                                users#login
#                        profile        /profile(.:format)                              users#profile
#                       products GET    /products(.:format)                             products#index
#                                POST   /products(.:format)                             products#create
#                    new_product GET    /products/new(.:format)                         products#new
#                   edit_product GET    /products/:id/edit(.:format)                    products#edit
#                        product GET    /products/:id(.:format)                         products#show
#                                PUT    /products/:id(.:format)                         products#update
#                                DELETE /products/:id(.:format)                         products#destroy
#                          users GET    /users(.:format)                                users#index
#                                POST   /users(.:format)                                users#create
#                       new_user GET    /users/new(.:format)                            users#new
#                      edit_user GET    /users/:id/edit(.:format)                       users#edit
#                           user GET    /users/:id(.:format)                            users#show
#                                PUT    /users/:id(.:format)                            users#update
#                                DELETE /users/:id(.:format)                            users#destroy
#                      merchants GET    /merchants(.:format)                            merchants#index
#                                POST   /merchants(.:format)                            merchants#create
#                   new_merchant GET    /merchants/new(.:format)                        merchants#new
#                  edit_merchant GET    /merchants/:id/edit(.:format)                   merchants#edit
#                       merchant GET    /merchants/:id(.:format)                        merchants#show
#                                PUT    /merchants/:id(.:format)                        merchants#update
#                                DELETE /merchants/:id(.:format)                        merchants#destroy
#    merchant_product_categories GET    /merchant_product_categories(.:format)          merchant_product_categories#index
#                                POST   /merchant_product_categories(.:format)          merchant_product_categories#create
#  new_merchant_product_category GET    /merchant_product_categories/new(.:format)      merchant_product_categories#new
# edit_merchant_product_category GET    /merchant_product_categories/:id/edit(.:format) merchant_product_categories#edit
#      merchant_product_category GET    /merchant_product_categories/:id(.:format)      merchant_product_categories#show
#                                PUT    /merchant_product_categories/:id(.:format)      merchant_product_categories#update
#                                DELETE /merchant_product_categories/:id(.:format)      merchant_product_categories#destroy
